<!--title-->
<div class="mnav1">
	<div class="m_nav">
		<div class="nav_left">
			<em class="home_icon"><?=$this->sys_name?></em><span>&nbsp;&gt;&nbsp;</span><font><?=$this->title?></font>
		</div>
	</div>
</div>

<div class="content-table">
<div class="content-table-title"><?=$this->title?></div>
<br />
<?php if($this->msg):?>
<div class="replace"><?=$this->msg?></div>
<br />
<?php endif;?>
<form action="/dcc/call-history/company_id/<?=$this->company_id?>" name="form1" method="GET">
通话时间：<input type="text" name="date_start" id="date_start" style="width: 100px"> ~ <input type="text" name="date_end" id="date_end" style="width: 100px">
&nbsp;&nbsp;&nbsp;&nbsp;
呼叫号码：<input type="text" name="call_in_num" <?php if($this->call_in_num){echo "value='".$this->call_in_num."'";}?> />
&nbsp;&nbsp;&nbsp;&nbsp;
分机号：<input type="text" name="call_phone" <?php if($this->call_phone){echo "value='".$this->call_phone."'";}?> />
<br />
呼叫方式：<select name="call_in_out" id="call_in_out">
	<option value="">不限</option>
	<option value="1" <?php if(1 == $this->call_in_out){echo "selected='selected'";}?>>呼入</option>
	<option value="2" <?php if(2 == $this->call_in_out){echo "selected='selected'";}?>>呼出</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;
是否接通：<select name="is_pick" id="is_pick">
	<option value="">不限</option>
	<option value="1" <?php if(1 == $this->is_pick){echo "selected='selected'";}?>>接通</option>
	<option value="0" <?php if(0 == $this->is_pick && is_numeric($this->is_pick)){echo "selected='selected'";}?>>未接通</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;
电销姓名：<input type="text" name="user_name" <?php if($this->user_name){echo "value='".$this->user_name."'";}?> />
&nbsp;&nbsp;&nbsp;&nbsp;

<input type="submit" class="button" value="搜索" />
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" class="button-cancle" value="清空搜索条件" onclick="location.href='?';" />
&nbsp;&nbsp;&nbsp;&nbsp;
<font color="red"><b>当前搜索结果: <?=$this->data['ct']?></b></font>
</form>
<br />

<table style="width: 100%">
  <tr>
    <th>呼叫号码</th>
    <th>呼叫时间</th>
    <th>接通时间</th>
    <th>总时长</th>
    <th>通话时长</th>
    <th>费用</th>
    <th>呼叫方式</th>
    <th>是否接通</th>
    <th>分机号</th>
    <th>电销姓名</th>
  </tr>
  <?php $data = $this->data['current_page_info']; ?>
  <?php foreach($data['customer_number'] as $id => $something):?>
  <tr>
    <td><?=isset($data["customer_number"][$id])?$data["customer_number"][$id]:""?></td>
    <td><?=isset($data["start_time"][$id])?$data["start_time"][$id]:""?></td>
    <td><?=isset($data["bridge_time"][$id])?$data["bridge_time"][$id]:""?></td>
    <td><?=isset($data["total_duration"][$id])?$data["total_duration"][$id]:""?></td>
    <td><?=isset($data["bridge_duration"][$id])?$data["bridge_duration"][$id]:""?></td>
    <td><?=isset($data["actual_price"][$id])?$data["actual_price"][$id]:""?></td>
    <td><?=(1==$data["record_type"][$id])?"呼入":"呼出"?></td>
    <td><?=("00:00:00"==$data["bridge_duration"][$id])?"未接通":"接通"?></td>
    <td><?=isset($data["call_phone"][$id])?$data["call_phone"][$id]:""?></td>
    <td><?=isset($data["user_name"][$id])?$data["user_name"][$id]:""?></td>
  </tr>
  <?php endforeach;?>
</table>

<br /><br />
<div align="right"><?=$this->pagination?></div>
<br /><br /><br />

<script>
var date = new Date();//获取当前时间  
date.setDate(date.getDate()-1);
  
$(function() {
	$( "#date_start" ).datepicker({ dateFormat: 'yy-mm-dd', maxDate: date}).datepicker("setDate", "<?=$this->date_start?>");
});

$(function() {
	$( "#date_end" ).datepicker({ dateFormat: 'yy-mm-dd', maxDate: date}).datepicker("setDate", "<?=$this->date_end?>");
});

</script>
